/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 *                                                                  *
 *        *************************************************         *
 *        *©2021-2027 HT Corporation All rights reserved *          *
 *        *************************************************         *
 *                                                                  *
 * FileName    : platform_comm.c                                    *
 *                                                                  *
 * Author      : linus                                              *
 *                                                                  *
 * Email       : luoyaojun@haitutech.com                            *
 *                                                                  *
 * Date        : 2022-8-10                                          *
 *                                                                  *
 * Description :                                                    *
 *                                                                  *
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#include "common.h"

HT_S32 platform_comm_get_wh(HT_VO_INTF_SYNC enIntfSync, HT_U32 *pu32W, HT_U32 *pu32H, HT_U32 *pu32Frm)
{
    switch (enIntfSync)
    {
    case HT_VO_OUTPUT_PAL:
        *pu32W = 720;
        *pu32H = 576;
        *pu32Frm = 25;
        break;
    case HT_VO_OUTPUT_NTSC:
        *pu32W = 720;
        *pu32H = 480;
        *pu32Frm = 30;
        break;
    case HT_VO_OUTPUT_1080P24:
        *pu32W = 1920;
        *pu32H = 1080;
        *pu32Frm = 24;
        break;
    case HT_VO_OUTPUT_1080P25:
        *pu32W = 1920;
        *pu32H = 1080;
        *pu32Frm = 25;
        break;
    case HT_VO_OUTPUT_1080P30:
        *pu32W = 1920;
        *pu32H = 1080;
        *pu32Frm = 30;
        break;
    case HT_VO_OUTPUT_720P50:
        *pu32W = 1280;
        *pu32H = 720;
        *pu32Frm = 50;
        break;
    case HT_VO_OUTPUT_720P60:
        *pu32W = 1280;
        *pu32H = 720;
        *pu32Frm = 60;
        break;
    case HT_VO_OUTPUT_1080I50:
        *pu32W = 1920;
        *pu32H = 1080;
        *pu32Frm = 50;
        break;
    case HT_VO_OUTPUT_1080I60:
        *pu32W = 1920;
        *pu32H = 1080;
        *pu32Frm = 60;
        break;
    case HT_VO_OUTPUT_1080P50:
        *pu32W = 1920;
        *pu32H = 1080;
        *pu32Frm = 50;
        break;
    case HT_VO_OUTPUT_1080P60:
        *pu32W = 1920;
        *pu32H = 1080;
        *pu32Frm = 60;
        break;
    case HT_VO_OUTPUT_576P50:
        *pu32W = 720;
        *pu32H = 576;
        *pu32Frm = 50;
        break;
    case HT_VO_OUTPUT_480P60:
        *pu32W = 720;
        *pu32H = 480;
        *pu32Frm = 60;
        break;
    case HT_VO_OUTPUT_800x600_60:
        *pu32W = 800;
        *pu32H = 600;
        *pu32Frm = 60;
        break;
    case HT_VO_OUTPUT_1024x768_60:
        *pu32W = 1024;
        *pu32H = 768;
        *pu32Frm = 60;
        break;
    case HT_VO_OUTPUT_1280x1024_60:
        *pu32W = 1280;
        *pu32H = 1024;
        *pu32Frm = 60;
        break;
    case HT_VO_OUTPUT_1366x768_60:
        *pu32W = 1366;
        *pu32H = 768;
        *pu32Frm = 60;
        break;
    case HT_VO_OUTPUT_1440x900_60:
        *pu32W = 1440;
        *pu32H = 900;
        *pu32Frm = 60;
        break;
    case HT_VO_OUTPUT_1280x800_60:
        *pu32W = 1280;
        *pu32H = 800;
        *pu32Frm = 60;
        break;
    case HT_VO_OUTPUT_1600x1200_60:
        *pu32W = 1600;
        *pu32H = 1200;
        *pu32Frm = 60;
        break;
    case HT_VO_OUTPUT_1680x1050_60:
        *pu32W = 1680;
        *pu32H = 1050;
        *pu32Frm = 60;
        break;
    case HT_VO_OUTPUT_1920x1200_60:
        *pu32W = 1920;
        *pu32H = 1200;
        *pu32Frm = 60;
        break;
    case HT_VO_OUTPUT_640x480_60:
        *pu32W = 640;
        *pu32H = 480;
        *pu32Frm = 60;
        break;
    case HT_VO_OUTPUT_960H_PAL:
        *pu32W = 960;
        *pu32H = 576;
        *pu32Frm = 50;
        break;
    case HT_VO_OUTPUT_960H_NTSC:
        *pu32W = 960;
        *pu32H = 480;
        *pu32Frm = 60;
        break;
    case HT_VO_OUTPUT_1920x2160_30:
        *pu32W = 1920;
        *pu32H = 2160;
        *pu32Frm = 30;
        break;
    case HT_VO_OUTPUT_2560x1440_30:
        *pu32W = 2560;
        *pu32H = 1440;
        *pu32Frm = 30;
        break;
    case HT_VO_OUTPUT_2560x1600_60:
        *pu32W = 2560;
        *pu32H = 1600;
        *pu32Frm = 60;
        break;
    case HT_VO_OUTPUT_3840x2160_30:
        *pu32W = 3840;
        *pu32H = 2160;
        *pu32Frm = 30;
        break;
    case HT_VO_OUTPUT_3840x2160_60:
        *pu32W = 3840;
        *pu32H = 2160;
        *pu32Frm = 60;
        break;
//    case HT_VO_OUTPUT_320x240_60    :
//        *pu32W = 320;
//        *pu32H = 240;
//        *pu32Frm = 60;
//        break;
//    case HT_VO_OUTPUT_320x240_50    :
//        *pu32W = 320;
//        *pu32H = 240;
//        *pu32Frm = 50;
//        break;
//    case HT_VO_OUTPUT_240x320_50    :
//        *pu32W = 240;
//        *pu32H = 320;
//        *pu32Frm = 50;
//        break;
//    case HT_VO_OUTPUT_240x320_60    :
//        *pu32W = 240;
//        *pu32H = 320;
//        *pu32Frm = 60;
//        break;
//    case HT_VO_OUTPUT_800x600_50    :
//        *pu32W = 800;
//        *pu32H = 600;
//        *pu32Frm = 50;
//        break;
    case HT_VO_OUTPUT_720x1280_60:
        *pu32W = 720;
        *pu32H = 1280;
        *pu32Frm = 60;
        break;
//    case HT_VO_OUTPUT_1080x1920_60    :
//        *pu32W = 1080;
//        *pu32H = 1920;
//        *pu32Frm = 60;
//        break;
    case HT_VO_OUTPUT_7680x4320_30:
        *pu32W = 7680;
        *pu32H = 4320;
        *pu32Frm = 30;
        break;
    case HT_VO_OUTPUT_7680x4320_60:
        *pu32W = 7680;
        *pu32H = 4320;
        *pu32Frm = 60;
        break;

    case HT_VO_OUTPUT_USER:
        *pu32W = 720;
        *pu32H = 576;
        *pu32Frm = 25;

        break;
    default:
        printf("vo enIntfSync %d not support!\n", enIntfSync);
        return -1;
    }

    return 0;
}
